package gui;

import java.awt.*;
import java.util.ArrayList;


public class Schilder extends Canvas {

	private static final long serialVersionUID = 1L;
	private ArrayList<NodeMetCoordinaten> coordinates;
	private int nodeWidth, nodeHeight;

	public Schilder(ArrayList<NodeMetCoordinaten> c, int nWidth, int nHeight) {		
		coordinates=c;
		nodeWidth = nWidth;
		nodeHeight = nHeight;
		
	}
	
	public void paint(Graphics g) {
		int c[], p[];
		for(NodeMetCoordinaten cnode : coordinates) {
			c = cnode.getCoordinates();
			p = cnode.getPappa();
			g.drawRect(c[0], c[1], nodeWidth, nodeHeight);
			g.drawString(cnode.getLabel(), c[0], c[1]);
			if (p != null) 
				g.drawLine(p[0], p[1]+nodeHeight, c[0], c[1]);
		}
		
	}
}
